package com.example.demo.mapper;


import com.example.demo.enity.Authority;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AuthorityMapper {


    @Select("select a.id, a.authority\n" +
            "from user_table u,\n" +
            "     user_authority_table ua,\n" +
            "     authority_table a\n" +
            "where u.id = ua.u_id\n" +
            "  and a.id = ua.a_id\n" +
            "  and u.username = #{username}")
    public List<Authority> getAuthorityByUsername(String username);

}
